<template>
  <div>
    <table width="100%" bgcolor="#cccccc" cellpadding="1" cellspacing="1">
      <tr>

        <td valign="top" bgcolor="white">
          <div id="WebOCX"><object
            id="WebOffice"
            classid="clsid:FF09E4FA-BFAA-486E-ACB4-86EB0AE875D5"
            codebase="http://www.officectrl.com/weboffice/WebOffice.ocx#Version=2018,1,6,2"
            width="100%"
            height="900"
          >
            <param name="BorderStyle" value="1">
            <param name="Menubar" value="0">
            <param name="Titlebar" value="1">
            <param name="Toolbars" value="1"></object></div>
        </td>
      </tr>
    </table>
  </div>
</template>
<script>
import * as WebCtrl from '@/assets/WebOffice.js' // 注意路径
export default {
  data() {
    return {
      wordPath: this.$store.getters
    }
  },
  created() {
    console.log(this.$store.getters)
  },
  mounted: function() {
	  WebCtrl.LoadCtrl(WebOCX)
    if (document.getElementById('WebOffice')) {
      document.getElementById('WebOffice').UserName = '贵州鼎慧大数据科技有限公司'
      WebOffice.Open('http://topsmart.xyz:1315/group1/M00/00/B0/wKgAnV4GN-eAOqwgAAEWq8yhsuE955.doc', true, 'Word.Document')
    }
  },
  methods: {
    NoCopyIt: function(e) { WebCtrl.isNotCopy(e) },
    WebSignature: function(e) {
      var strpic
      if (e == 1)strpic = '001.gif'
      if (e == 2)strpic = '002.gif'
      if (e == 3)strpic = '003.gif'
      WebCtrl.WebSignature('http://www.officectrl.com/weboffice/images/' + strpic)
    },
    WebSave: function() {
      WebOffice.Save('http://www.officectrl.com/officecs/uploadedit.aspx?oper=edit&flsid=4167975720113410419&flag=1') // uploadedit.aspx是表单一个文件上传的后二进制接收器
    },
    WebHttpSave: function() {
      WebOffice.HttpInit()
      WebOffice.HttpAddPostString('filename', '4167975720113410419.doc')
      WebOffice.HttpAddPostCurrFile('docfile', '')
      var strResults = WebOffice.HttpPost('http://www.officectrl.com/officecs/postsave.aspx') // postsave.aspx是表单一个文件上传的后二进制接收器
      if (strResults == 'ok')alert('保存成功！')
    },
    WebDocReload: function() {
	 location.reload()
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
